package com.yeyks.consumer.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.pagehelper.PageHelper;
import com.yeyks.common.base.PageResult;
import com.yeyks.consumer.dal.domain.FishBallGoodsMessage;
import com.yeyks.consumer.dal.dao.FishBallGoodsMessageMapper;
import com.yeyks.consumer.service.FishBallGoodsMessageService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author yun
 * @since 2020-04-15
 */
@Service
public class FishBallGoodsMessageServiceImpl extends ServiceImpl<FishBallGoodsMessageMapper, FishBallGoodsMessage> implements FishBallGoodsMessageService {

    @Override
    public PageResult<FishBallGoodsMessage> queryPage(Integer pageNum, Integer pageSize) {

        PageHelper.startPage(pageNum, pageSize);

        List<FishBallGoodsMessage> list = baseMapper.selectList(new QueryWrapper<FishBallGoodsMessage>()
                .orderByDesc(FishBallGoodsMessage.CREATE_TIME));

        return PageResult.getPageResult(list);
    }
}
